/*
 * 	<pre>
 *	EasyPeas.
 *  Copyright (C) 2007 S Owen
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 * 
 * Jul 24, 2007
 * Accessor.java
 * </pre>
 */
package org.easypeas.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * <p>
 * Signifies a method that acts as an accessor to another Pea. e.g.
 * </p>
 * <code>public Info getInfo() => /.../info/...</code>
 * <p>
 * Accessors can be chained and what they return must be annotated as
 * 
 * @EasyPea<br>
 *          The last Pea in the chain must always have some
 * @Views or
 * @Actions, or an id(String) method to be meaningful.
 *           </p>
 * 
 * @see EasyPea
 * 
 * @author S Owen
 */
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = ElementType.METHOD)
public @interface Accessor {

	/**
	 * Provides a name to the accessor which must be unique for all HTTP GET
	 * methods for this EasyPea.<br>
	 * The name maps to the part of the URL path after the EasyPea name, or an
	 * EasyPea returned from another accessor;<br>
	 * e.g. GET /books/best => the accessor named <em>best</em> for the
	 * EasyPea named <em>books</em>.
	 */
	String name();
}
